<?php
  defined('_JEXEC') or die('Retricted Access');
?>

<style type="text/css">
textarea.ja-editor-code {
	-moz-background-clip:border;
	-moz-background-inline-policy:continuous;
	-moz-background-origin:padding;
	background:transparent url(components/com_jajobboard/asset/line-numbers.png) no-repeat scroll 0 0;
	font-family:monospace;
	font-size:13px;
	line-height:16px;
	margin-right:26px;
	padding-left:30px;
	padding-top:11px;
	width:95%;
}
</style>
<script type="text/javascript">

function catchTab(item, e) {
	if (navigator.userAgent.match("Gecko")) {
		c = e.which;
	} else {
		c = e.keyCode;
	}
	if (c == 9) {
		var offset = $('editFile').scrollTop;
		replaceSelection(item, String.fromCharCode(9));
		setTimeout("document.getElementById('" + item.id + "').focus();", 0);

		$('editFile').scrollTop(offset);
		offset = offset * -1;
		offset = '0 ' + offset + 'px';
		$(e).setStyle('background-position', offset);

		return false;
	}

}
function scrollEditor(e) {
	var offset = $(e).scrollTop;
	offset = offset * -1;
	offset = '0 ' + offset + 'px';
	$(e).setStyle('background-position', offset);

}
</script>
<center>
<div style="width: 90%; border: 1px solid rgb(153, 153, 153); padding: 4px; text-align: left; background: #FFFFDD">
 		<img border="0" src="../includes/js/ThemeOffice/warning.png" alt="Tooltip"/>
 		<?php echo sprintf(JText::_("WARNING MSG CUSTOM TPL"), $this->file, $this->template, $this->folder, $this->file, $this->file, $this->file);?>
</div>
</center>
<br/>
	

<form name="adminForm" action="index.php" method="post">
    <table width="100%">
		<tr>
	
		<td width="<?php if($this->is_override) echo '50%'; else echo '100%';?>" valign="top">
			<fieldset>
				<legend><?php echo JText::_('Original content');?> </legend>    
		    	<p>
		    	( <?php echo JText::_( 'Path' ); ?>: <?php echo JPATH_COMPONENT_SITE.DS.$this->folder.DS.'tmpl'.DS.$this->file;?> ) <br/>
		    	<?php if($this->is_override){?><font color="red"><?php echo JText::_('This content can only be read !')?></font> <?php }?>
		    	</p>
				<textarea style="width: 95%;" class="inputbox ja-editor-code" wrap="off" spellcheck="false" onscroll="scrollEditor(this);" <?php if($this->is_override){?>readonly="readonly" name="content_1"<?php } else{?> name="content" <?php }?> style="width:100%" rows="40"><?php echo $this->content; ?></textarea>	
		     </fieldset>    
			
		</td>
		
		<?php if($this->is_override){?>
		<td width="50%" valign="top">
			<fieldset>
				<legend><?php echo JText::_('Content Override');?> </legend>    
		    	<p>( <?php echo JText::_( 'Path' ); ?>: <?php echo $this->path_override;?> )</p>
				<textarea style="width: 95%;" class="inputbox ja-editor-code" wrap="off" spellcheck="false" onscroll="scrollEditor(this);" onkeydown="return catchTab(this,event)" name="content" style="width:100%" rows="40"><?php echo $this->override_content; ?></textarea>	
		     </fieldset>    
		</td>
		<?php }?>
		
	</tr>
	</table>
	
	<input type="hidden" name="file" value="<?php echo $this->file; ?>" />
	<input type="hidden" name="folder" value="<?php echo $this->folder; ?>" />
	<input type="hidden" name="option" value="<?php echo $this->option; ?>" />
	<input type="hidden" name="view" value="jacustomtmpl" />
	<input type="hidden" name="task" value="" />
	<?php echo JHTML::_( 'form.token' ); ?>	
 </form>